Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing an Alternative for Visualizing Diameter Messages. #185

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Introducing an Alternative for Visualizing Diameter Messages. #185

merged 1 commit into from
Nov 16, 2023

Conversation

lwlee2608
Copy link
Contributor

I would like to propose a new format for visualizing Diameter messages.

Current diam.Message.String() output:

    Credit-Control-Request (CCR)
    {Code:272,Flags:0x80,Version:0x1,Length:244,ApplicationId:4,HopByHopId:0xa8cc407d,EndToEndId:0xa8c1b2b4}
            Origin-Host {Code:264,Flags:0x40,Length:12,VendorId:0,Value:DiameterIdentity{test},Padding:0}
            Origin-Realm {Code:296,Flags:0x40,Length:20,VendorId:0,Value:DiameterIdentity{localhost},Padding:3}
            Host-IP-Address {Code:257,Flags:0x40,Length:16,VendorId:0,Value:Address{10.1.0.1},Padding:2}
            Vendor-Id {Code:266,Flags:0x40,Length:12,VendorId:0,Value:Unsigned32{13}}
            Session-Id {Code:263,Flags:0x40,Length:24,VendorId:0,Value:UTF8String{sess;123456789},Padding:2}
            Origin-State-Id {Code:278,Flags:0x40,Length:12,VendorId:0,Value:Unsigned32{1397760650}}
            CC-Request-Type {Code:416,Flags:0x40,Length:12,VendorId:0,Value:Enumerated{1}}
            CC-Request-Number {Code:415,Flags:0x40,Length:12,VendorId:0,Value:Unsigned32{1000}}
            Multiple-Services-Credit-Control {Code:456,Flags:0x40,Length:48,VendorId:0,Value:Grouped{
                    Service-Identifier {Code:439,Flags:0x40,Length:12,VendorId:0,Value:Unsigned32{7786}},
                    Rating-Group {Code:432,Flags:0x40,Length:12,VendorId:0,Value:Unsigned32{7786}},
                    TGPP-RAT-Type {Code:21,Flags:0xc0,Length:16,VendorId:10415,Value:OctetString{0x31323334},Padding:0},
            }}
            Service-Information {Code:873,Flags:0xc0,Length:56,VendorId:10415,Value:Grouped{
                    PS-Information {Code:874,Flags:0xc0,Length:44,VendorId:10415,Value:Grouped{
                            Called-Station-Id {Code:30,Flags:0x40,Length:16,VendorId:0,Value:UTF8String{10999},Padding:3},
                            Start-Time {Code:2041,Flags:0xc0,Length:16,VendorId:10415,Value:Time{2013-08-21 22:06:14 +0800 +08}},
                    }}
            }}

Proposed new diam.Message.PrettyDump()

      Credit-Control(272) Charging-Control(4) request 2831958141, 2831266484
        AVP                                        Vendor  Code  V M P  Type                Value
        Origin-Host                                     0   264  ✗ ✓ ✗  DiameterIdentity    test
        Origin-Realm                                    0   296  ✗ ✓ ✗  DiameterIdentity    localhost
        Host-IP-Address                                 0   257  ✗ ✓ ✗  Address             10.1.0.1
        Vendor-Id                                       0   266  ✗ ✓ ✗  Unsigned32          13
        Session-Id                                      0   263  ✗ ✓ ✗  UTF8String          sess;123456789
        Origin-State-Id                                 0   278  ✗ ✓ ✗  Unsigned32          1397760650
        CC-Request-Type                                 0   416  ✗ ✓ ✗  Enumerated          1
        CC-Request-Number                               0   415  ✗ ✓ ✗  Unsigned32          1000
        Multiple-Services-Credit-Control                0   456  ✗ ✓ ✗  Grouped
          Service-Identifier                            0   439  ✗ ✓ ✗  Unsigned32          7786
          Rating-Group                                  0   432  ✗ ✓ ✗  Unsigned32          7786
          TGPP-RAT-Type                             10415    21  ✗ ✓ ✗  OctetString         1234
        Service-Information                         10415   873  ✓ ✓ ✗  Grouped
          PS-Information                            10415   874  ✓ ✓ ✗  Grouped
            Called-Station-Id                           0    30  ✓ ✓ ✗  UTF8String          10999
            Start-Time                              10415  2041  ✓ ✓ ✗  Time                2013-08-21 22:06:14 +0800 +08

I am open to any comments, feedback, or suggestions and would be happy to discuss further.

@fiorix fiorix merged commit 845be29 into fiorix:master Nov 16, 2023
1 check passed
@fiorix
Copy link
Owner

fiorix commented Nov 16, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants